Behnam Esfahbod [Thu, 31 Aug 2017 01:15:26 +0000 (18:15 -0700)]
[src/doc/book] Check 03-08-source-replacement.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:14:29 +0000 (18:14 -0700)]
[src/doc/book] Update 03-10-policies.md from policies.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:12:51 +0000 (18:12 -0700)]
[src/doc/book] Check 03-07-pkgid-spec.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:10:13 +0000 (18:10 -0700)]
[src/doc/book] Update 03-02-manifest.md from manifest.md
Behnam Esfahbod [Thu, 31 Aug 2017 01:02:21 +0000 (18:02 -0700)]
[src/doc/book] Apply 01-*.md changes into index.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:38:47 +0000 (17:38 -0700)]
[src/doc/book] Update guide.md and 02-*.md from guide.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:26:34 +0000 (17:26 -0700)]
[src/doc/book] Check faq.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:13:49 +0000 (17:13 -0700)]
[src/doc/book] Update 03-09-external-tools.md from external-tools.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:12:06 +0000 (17:12 -0700)]
[src/doc/book] Update 03-04-environment-variables.md from environment-variables.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:08:18 +0000 (17:08 -0700)]
[src/doc/book] Update 03-06-crates-io.md from crates-io.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:05:21 +0000 (17:05 -0700)]
[src/doc/book] Update 03-05-build-scripts.md from build-script.md
Behnam Esfahbod [Thu, 31 Aug 2017 00:00:04 +0000 (17:00 -0700)]
[src/doc/book] Update 03-03-config.md from config.md
Behnam Esfahbod [Wed, 30 Aug 2017 22:45:37 +0000 (15:45 -0700)]
[src/doc/book] Add .gitignore
Using `mdbook init` command.
Also, update `.gitignore` file manually and add a leading slash.
(Upstream fix for mdBook: <https://github.com/azerupi/mdBook/pull/413>)
Behnam Esfahbod [Wed, 30 Aug 2017 22:38:51 +0000 (15:38 -0700)]
[src/doc/book] Import from cargo-book repo
bors [Wed, 30 Aug 2017 15:40:20 +0000 (15:40 +0000)]
Auto merge of #4451 - steveklabnik:relax-rustdoc-tests, r=alexcrichton
relax rustdoc tests
This was asserting on the output directly, rather than just what it contains.
In https://github.com/rust-lang/rust/pull/44138 we are adding deprecations, and so it
breaks these tests.
steveklabnik [Wed, 30 Aug 2017 14:50:40 +0000 (10:50 -0400)]
Don't use deprecated rustdoc flags in tests
In rust-lang/rust#44138 we are adding deprecations, and so it
breaks these tests.
bors [Tue, 29 Aug 2017 17:40:45 +0000 (17:40 +0000)]
Auto merge of #4440 - nisargthakkar:publish_target, r=alexcrichton
Adding target support to cargo package and cargo publish
Fixing Issue #4012
Same as #4077 but couldn't reopen the PR due to force push after rebasing from master
Nisarg Thakkar [Tue, 29 Aug 2017 15:08:02 +0000 (20:38 +0530)]
Removing redundant extern
Nisarg Thakkar [Sun, 27 Aug 2017 06:49:17 +0000 (12:19 +0530)]
Adding tests for --target with cargo publish and cargo package
Nisarg Thakkar [Sat, 20 May 2017 17:05:14 +0000 (22:35 +0530)]
Adding target support to cargo package and cargo publish
bors [Mon, 28 Aug 2017 15:52:06 +0000 (15:52 +0000)]
Auto merge of #4442 - Xanewok:process-builder-program, r=alexcrichton
Allow to substitute executed program in `ProcessBuilder`
Extends #4424. Sorry for the noise, turns out it'd also be useful to substite the executed program (e.g. for rls, which needs to use a rustc shim itself) without having to copy over manually all parts of the `ProcessBuilder`.
While I'm at it, do you think this needs even more functionality, like being able to specify `None` for the `cwd` or `jobserver` (currently API exposes only ability to specify `Some(...)` as values for those)?
r? @alexcrichton
bors [Mon, 28 Aug 2017 15:04:51 +0000 (15:04 +0000)]
Auto merge of #4445 - alexcrichton:bump, r=matklad
Bump Cargo to 0.23.0
Alex Crichton [Mon, 28 Aug 2017 15:03:42 +0000 (08:03 -0700)]
Fix tests on nightly
Alex Crichton [Mon, 28 Aug 2017 14:45:43 +0000 (07:45 -0700)]
Bump Cargo to 0.23.0
Igor Matuszewski [Sun, 27 Aug 2017 16:02:05 +0000 (18:02 +0200)]
Allow to substitute executed program in `ProcessBuilder`
bors [Sun, 27 Aug 2017 15:39:13 +0000 (15:39 +0000)]
Auto merge of #4441 - vignesh-sankaran:manifest-doc-fix, r=alexcrichton
Replace maintenance status with ellipses
Since the default maintenance status isn't set to none if it isn't set, feel it'd be more appropriate to have ellipses instead like the other badge docs.
Vignesh [Sun, 27 Aug 2017 11:19:58 +0000 (21:19 +1000)]
Replace maintenance status badge none with ellipses
bors [Sun, 27 Aug 2017 07:41:33 +0000 (07:41 +0000)]
Auto merge of #4439 - ishitatsuyuki:bench-cleanup, r=matklad
Gate extern crates for bench tests
I tried my best to skim through the `extern crate` statements, and I hope this will unblock the unused extern crates PR.
Tatsuyuki Ishi [Sun, 27 Aug 2017 07:31:16 +0000 (16:31 +0900)]
Fix remaining test failures
Tatsuyuki Ishi [Sun, 27 Aug 2017 07:14:15 +0000 (16:14 +0900)]
tests/cfg: allow unused extern crates
Tatsuyuki Ishi [Sun, 27 Aug 2017 07:10:54 +0000 (16:10 +0900)]
tests/build-script: allow unused extern crates
Tatsuyuki Ishi [Sun, 27 Aug 2017 05:57:22 +0000 (14:57 +0900)]
Gate feature for bench tests
Tatsuyuki Ishi [Sun, 27 Aug 2017 05:30:13 +0000 (14:30 +0900)]
Gate extern crates for bench tests
bors [Sat, 26 Aug 2017 17:57:40 +0000 (17:57 +0000)]
Auto merge of #4358 - Mark-Simulacrum:fix-cfg-cargo, r=alexcrichton
Discover crate type information late if necessary.
Some crates aren't found during eager crate-type searching due to being behind `cfg(...)` flags. We still want to be able to handle these, though, so when necessary we now call rustc again to get crate-type information for these cfg-ed crates.
This is necessary for https://github.com/rust-lang/rust/pull/41991.
r? @alexcrichton
bors [Sat, 26 Aug 2017 15:18:46 +0000 (15:18 +0000)]
Auto merge of #4437 - ishitatsuyuki:deps-purge, r=matklad
Purge deps, round 2
Sorry for creating so much iterations, I have no local build of the new compiler :)
Mark Simulacrum [Mon, 21 Aug 2017 11:46:31 +0000 (05:46 -0600)]
Discover crate type information late if necessary.
Some crates aren't found during eager crate-type searching due to being
behind `cfg(...)` flags. We still want to be able to handle these,
though, so when necessary we now call rustc again to get crate-type
information for these cfg-ed crates.
Tatsuyuki Ishi [Sat, 26 Aug 2017 14:36:13 +0000 (23:36 +0900)]
Purge deps, round 2
bors [Sat, 26 Aug 2017 10:01:15 +0000 (10:01 +0000)]
Auto merge of #4435 - ishitatsuyuki:deps-purge, r=matklad
Purge unused extern crates
Tatsuyuki Ishi [Sat, 26 Aug 2017 09:59:51 +0000 (18:59 +0900)]
Purge unused extern crates
bors [Fri, 25 Aug 2017 16:02:02 +0000 (16:02 +0000)]
Auto merge of #4433 - alexcrichton:unstable-features, r=matklad
Add infrastructure for nightly features and flags
This PR starts adding infrastructure in Cargo for nightly features and nightly flags. The current design looks like:
* There's a new `package.cargo-features` manifest key which accepts an array of strings. This array of strings is the list of enabled Cargo features for that crate.
* A new suite of flags behind `-Z`, like the compiler, are accepted on the command line for all commands.
* Features and unstable flags in Cargo are required to be used on Cargo's nightly channel, which is the same as Rust's nightly channel.
* Features and unstable flags cannot be used on the stable/beta channels of Rust/Cargo.
* Crates which enable features in their manifest are disallowed from being published to crates.io
The motivation behind this support is unblock a number of efforts in Cargo by allowing them to safely get implemented behind a nightly feature gate. Once behind a feature gate they can iterate in-tree without having to worry about "insta stability" and we can also get valuable usage feedback about upstream users.
Closes https://github.com/rust-lang/cargo/issues/4409
Alex Crichton [Thu, 24 Aug 2017 22:04:46 +0000 (15:04 -0700)]
Add infrastructure for nightly Cargo flags
Alex Crichton [Thu, 24 Aug 2017 19:54:57 +0000 (12:54 -0700)]
Add support for nightly features in Cargo
bors [Thu, 24 Aug 2017 13:56:50 +0000 (13:56 +0000)]
Auto merge of #4431 - vignesh-sankaran:maintenance-badge-docs, r=alexcrichton
Add maintenance badge docs
Pending merging of [this PR for crates.io](https://github.com/rust-lang/crates.io/pull/952). This should close off [#704 on crates.io](https://github.com/rust-lang/crates.io/issues/704). I've also updated the badge metadata docs and reordered the fields into groups by build, code coverage, and maintenance.
So I've decided to put the list of possible badge options in the documentation, we'll have to find another place to put more detailed descriptions of the available maintenance badges.
Vignesh [Thu, 24 Aug 2017 05:33:52 +0000 (15:33 +1000)]
Added maintenance badge and reordered badge metadata fields
bors [Thu, 24 Aug 2017 09:39:40 +0000 (09:39 +0000)]
Auto merge of #4432 - potocpav:patch-1, r=matklad
Correct a paragraph
The previous formulation was incorrect in the descriptions of the `x` and `y` version numbers.
Pavel Potocek [Thu, 24 Aug 2017 09:22:09 +0000 (11:22 +0200)]
Correct an inaccuracy
bors [Thu, 24 Aug 2017 09:01:00 +0000 (09:01 +0000)]
Auto merge of #4429 - ishitatsuyuki:test-purge, r=matklad
cargotest: purge deps
Blocking rust-lang/rust#42588.
Pavel Potocek [Thu, 24 Aug 2017 08:52:12 +0000 (10:52 +0200)]
Correct and reword a paragraph
The previous formulation was incorrect in the descriptions of the `x` and `y` version numbers.
Tatsuyuki Ishi [Thu, 24 Aug 2017 03:56:47 +0000 (12:56 +0900)]
cargotest: purge deps
bors [Tue, 22 Aug 2017 15:26:56 +0000 (15:26 +0000)]
Auto merge of #4424 - Xanewok:process-builder-api, r=alexcrichton
Add `fn args_replace` and `fn get_program` to `ProcessBuilder`
`Executor::exec()` provides a `ProcessBuilder` argument representing compiler call and if someone wants to use it or modify it for their own purposes, they have to (partially) recreate it themselves.
This:
* makes the argument modification possible (via `args_replace`, analogous to `env_remove`)
* exposes the program that will be run (via `get_program`, in case `rustc` is overriden via wrapper etc.).
r? @alexcrichton
Igor Matuszewski [Tue, 22 Aug 2017 15:13:00 +0000 (17:13 +0200)]
Add `fn args_replace` and `fn get_program` to `ProcessBuilder`
bors [Sun, 20 Aug 2017 18:35:22 +0000 (18:35 +0000)]
Auto merge of #4416 - Xanewok:more-executor-params, r=alexcrichton
Expose `Target` and `Unit` params to appropriate `Executor` callbacks
This effectively does only two things:
* Pass existing `&Unit` to `init()`
* Pass existing `&Target` to `exec()`s
Also updated doc comments slightly.
The `init()` is called for every `Work` preparation by `rustc()` and since it's not called once (not sure if intended?), it'd be good to include more information for which `Unit` the `rustc` process invocation has been initially prepared (I think more importantly it shows that `init()` is called many times for many targets).
Additionally, it'd be good to know about `Unit` compiled in the `exec()` callbacks in more structured manner (so the user doesn't have to parse the `ProcessBuilder` arguments and/or make certain assumptions) and since `target` was already cloned and moved into the closure, it was only a matter of exposing it.
I think it'd be ideal to provide all the necessary information to recreate a `Unit` but with a static lifetime needed for the closure, however this would mean cloning more data per-target ([`Kind`](https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_rustc/mod.rs#L41) should be basically free, however not sure if cloning [`Profile`](https://github.com/rust-lang/cargo/blob/master/src/cargo/core/manifest.rs#L151) is acceptable). With this, `Executor` users could query `Context` more easily (e.g. to get a unit dep graph! :smile:), as the API accepts `Unit`s in many places.
r? @alexcrichton
cc @nrc
EDIT:
This changes the public API, not sure if there's something else I should do about it, only ran `cargo test` locally.
bors [Sun, 20 Aug 2017 12:57:50 +0000 (12:57 +0000)]
Auto merge of #4364 - RalfJung:feat, r=alexcrichton
Required dependencies are not features
Also, while I was at it, I fixed an error message which complained about something not being an optional dependency, when really what mattered was that it was not a dependency at all.
I made a bunch of guesses about how things work. These guesses ended up as comments in the commit (so hopefully, the next reader of these files has to guess less). I am not totally certain these comments are all correct, so please yell if not. :)
In particular, for resolve_features, I observed that dependencies get compiled even when they are not returned from that function. But judging from how the function used to behave, it actually returns all dependencies, even those that have nothing to do with any features. (Making the name rather misleading, TBH...)
Fixes #4363
Igor Matuszewski [Sat, 19 Aug 2017 20:47:19 +0000 (22:47 +0200)]
Expose `Target` and `Unit` params to appropriate `Executor` callbacks
Ralf Jung [Fri, 18 Aug 2017 18:10:34 +0000 (20:10 +0200)]
fix borrowing the shell twice
Ralf Jung [Fri, 18 Aug 2017 17:37:12 +0000 (19:37 +0200)]
Using required dep as a feature is a warning for now, not an error
bors [Thu, 17 Aug 2017 23:09:50 +0000 (23:09 +0000)]
Auto merge of #4400 - behnam:pr4157, r=alexcrichton
[check|build|rustc] Add --all-targets option
`cargo check` does not check all targets by default, and to check all,
you need to call it `cargo check --tests --examples --bins --benches`.
Here, we implement `--all-targets` For `check`, `build`, and `rustc`.
For consitency, `--all-targets` is also added to other commands like
`test` although "all targets" is the default behavior.
This is a rebase of <https://github.com/rust-lang/cargo/pull/4157>
Ralf Jung [Sat, 5 Aug 2017 04:27:26 +0000 (21:27 -0700)]
improve misleading error message
Ralf Jung [Sat, 5 Aug 2017 04:21:09 +0000 (21:21 -0700)]
detect required dependencies used as features
Ralf Jung [Sat, 5 Aug 2017 03:21:38 +0000 (20:21 -0700)]
test for mandatory dependencies not to be considered features
bors [Mon, 14 Aug 2017 23:23:05 +0000 (23:23 +0000)]
Auto merge of #4404 - parkovski:master, r=alexcrichton
Fix #4370 - init panic in C:\ or /
This fixes the crash in this issue, but the error message is strange - unable to create directory 'C:\\.'. I don't have write permissions there without becoming admin, so I suspect it's just a permission issue, but the weird error can be fixed by calling Path::canonicalize on line 300.
Parker Snell [Mon, 14 Aug 2017 18:02:07 +0000 (11:02 -0700)]
Fix #4370 - init panic in C:\ or /
bors [Sun, 13 Aug 2017 12:40:53 +0000 (12:40 +0000)]
Auto merge of #4402 - bluss:doc-rustdocflags, r=alexcrichton
Document `RUSTDOCFLAGS`
Documentation for this environment variable was missing. It's supported in stable releases of Rust already.
bluss [Sun, 13 Aug 2017 12:27:27 +0000 (14:27 +0200)]
Document `RUSTDOCFLAGS`
bors [Sat, 12 Aug 2017 22:08:54 +0000 (22:08 +0000)]
Auto merge of #4389 - matklad:testless, r=alexcrichton
Allow to skip test code during publishing
closes #4365
I don't have time to review this code carefully right now, but looks like it does the job.
Aleksey Kladov [Wed, 9 Aug 2017 21:54:09 +0000 (00:54 +0300)]
Allow to skip test code during publishing
bors [Sat, 12 Aug 2017 14:46:51 +0000 (14:46 +0000)]
Auto merge of #4393 - burtonageo:update-cargo-new-template, r=matklad
Update lib template for `cargo new` so that the placeholder test contains an assertion
When you run `rustfmt` on the default generated lib template, it modifies it as shown [here](https://play.rust-lang.org/?gist=
bd44610731e26e76719e75d47e598990&version=undefined)
Stepan Koltsov [Fri, 11 Aug 2017 01:46:07 +0000 (18:46 -0700)]
[check|build|rustc] Add --all-targets option
`cargo check` does not check all targets by default, and to check all,
you need to call it `cargo check --tests --examples --bins --benches`.
Here, we implement `--all-targets` For `check`, `build`, and `rustc`.
For consitency, `--all-targets` is also added to other commands like
`test` although "all targets" is the default behavior.
This is a rebase of <https://github.com/rust-lang/cargo/pull/4157>
bors [Fri, 11 Aug 2017 17:12:45 +0000 (17:12 +0000)]
Auto merge of #4398 - debris:url_4394, r=alexcrichton
Fixed panic when canonicalizing not-a-base-url, fixes #4394
Fixes #4394. Majority of the changes are caused by propagating error upstream to `SourceId` and `GitSource`.
debris [Fri, 11 Aug 2017 15:39:18 +0000 (17:39 +0200)]
Fix implementation and tests for cannot-be-a-base-url canonicalization
debris [Fri, 11 Aug 2017 14:25:19 +0000 (16:25 +0200)]
Fixed panic when canonicalizing not-a-base-url, fixes #4394
bors [Fri, 11 Aug 2017 07:28:15 +0000 (07:28 +0000)]
Auto merge of #4396 - vignesh-sankaran:documentation-blacklist-list-fix, r=matklad
Fix list rendering in manifest.md
Fixes a list rendering problem introduced in #4237.
Vignesh [Fri, 11 Aug 2017 05:18:21 +0000 (15:18 +1000)]
Fix list rendering for blacklisted hosts
George Burton [Thu, 10 Aug 2017 22:30:33 +0000 (23:30 +0100)]
Add a placeholder assertion in the new lib project template
George Burton [Thu, 10 Aug 2017 21:19:41 +0000 (22:19 +0100)]
Fix tests
George Burton [Thu, 10 Aug 2017 20:50:41 +0000 (21:50 +0100)]
Update lib template for `cargo new` so that it conforms to rustfmt style by default
bors [Thu, 10 Aug 2017 09:04:21 +0000 (09:04 +0000)]
Auto merge of #4390 - alexcrichton:read-hard-links, r=matklad
Use `same-file` to avoid unnecessary hard links
This is targeted at removing the need for a workaround in rust-lang/rust#39518,
allowing the main rust build system to move back to hard links which should be
much more efficient.
bors [Thu, 10 Aug 2017 05:11:28 +0000 (05:11 +0000)]
Auto merge of #4386 - pornel:backups, r=alexcrichton
Exclude target directory from Time Machine
Fixes #3884
Kornel [Wed, 9 Aug 2017 14:41:53 +0000 (15:41 +0100)]
Exclude target directory from Time Machine
Temporary/derived files outside dedicated system directories should be explicitly excluded from backups to prevent undesirable bloat and churn.
Alex Crichton [Thu, 10 Aug 2017 00:22:34 +0000 (17:22 -0700)]
Use `same-file` to avoid unnecessary hard links
This is targeted at removing the need for a workaround in rust-lang/rust#39518,
allowing the main rust build system to move back to hard links which should be
much more efficient.
bors [Wed, 9 Aug 2017 17:42:20 +0000 (17:42 +0000)]
Auto merge of #4384 - ivanbakel:unused_mut, r=alexcrichton
Fixed some variables being unnecessarily mutable
### Changes
Some variables are marked `mut` when they don't need to be. This PR changes those variables to no longer be `mut`.
### Context
PR on https://github.com/rust-lang/rust/pull/43582
tl:dr; There's a bug with the mutability checker that sometimes marks mutable ref variables as being used when they're not.
bors [Wed, 9 Aug 2017 16:30:21 +0000 (16:30 +0000)]
Auto merge of #4382 - Xanewok:expose-filter-rule, r=alexcrichton
Expose ops::cargo_compile::FilterRule
I've been mindlessly copying and consuming the Cargo API to work on the build plan prototype for RLS and I noticed that, it seems, pub `ops::cargo_compile::CompileFilter` is exported, but not the `ops::cargo_compile::FilterRule`, which `CompileFilter` uses, as a part of a public API.
If I'm wrong and missing something, feel free to ignore/close it. It was possible to match/destructure `CompileFilter` before, but with this change it's possible to use the underlying type.
Isaac van Bakel [Wed, 9 Aug 2017 15:11:04 +0000 (16:11 +0100)]
Fixed instance in Windows cfg.
Isaac van Bakel [Wed, 9 Aug 2017 14:37:54 +0000 (15:37 +0100)]
Fixed variables being unnecessarily mut.
bors [Wed, 9 Aug 2017 14:33:51 +0000 (14:33 +0000)]
Auto merge of #4378 - behnam:ignore, r=alexcrichton
[sources/path] Support leading slash in glob patterns
Background: https://github.com/rust-lang/cargo/issues/4268
This diff takes us to **Stage 1.1** of the migration plan by allowing
glob patterns to include a leading slash, so that glob patterns can be
updated, if needed, to start with a slash, closer to the future behavior
with gitignore-like matching.
Why is this stage needed?
It's common to have `package.include` set like this:
```
include = ["src/**"]
```
In old interpretation, this would only include all files under the `src`
directory under the package root. With the new interpretation, this
would match any path with some directory called `src`, even if it's not
directly under the package root.
After this patch, package owners can start marking glob patters with a
leading slash to fix the warning thrown, if any.
One thing to notice here is that there are no extra matchings, but, if
a manifest has already a pattern with a leading slash, this would
silently start matching it with the paths. I believe this is fine, since
the old behavior would have been for the pattern to not match anything,
therefore the item was useless.
See also <https://github.com/rust-lang/cargo/issues/4377> for suggestion
to throw warning on useless/invalid patterns in these fields.
bors [Wed, 9 Aug 2017 14:10:12 +0000 (14:10 +0000)]
Auto merge of #3611 - tylerwhall:stable-metadata, r=alexcrichton
Stable metadata hashes across workspaces
Currently a crate from a path source will have its metadata hash incorporate its absolute path on the system where it is built. This always impacts top-level crates, which means that compiling the same source with the same dependencies and compiler version will generate libraries with symbol names that vary depending on where the workspace resides on the machine.
This is hopefully a general solution to the hack we've used in meta-rust to make dynamic linking reliable.
meta-rust/meta-rust@
0e6cf94
For paths inside the Cargo workspace, hash their SourceId relative to the root of the workspace. Paths outside of a workspace are still hashed as absolute.
This stability is important for reproducible builds as part of a larger build system that employs caching of artifacts, such as OpenEmbedded.
OpenEmbedded tightly controls all inputs to a build and its caching assumes that an equivalent artifact will always result from the same set of inputs. The workspace path is not considered to be an influential input, however.
For example, if Cargo is used to compile libstd shared objects which downstream crates link to dynamically, it must be possible to rebuild libstd given the same inputs and produce a library that is at least link-compatible with the original. If the build system happens to cache the downstream crates but needs to rebuild libstd and the user happens to be building in a different workspace path, currently Cargo will generate a library incompatible with the original and the downstream executables will fail at runtime on the target.
Igor Matuszewski [Tue, 8 Aug 2017 11:01:44 +0000 (13:01 +0200)]
Expose ops::cargo_compile::FilterRule
bors [Tue, 8 Aug 2017 00:58:29 +0000 (00:58 +0000)]
Auto merge of #4376 - behnam:virtual, r=alexcrichton
[docs/manifest] Add Virtual Manifest section
Current documentation does not mention Virtual Manifests at all, which
can be confusing because they appear in error messages.
Here we add the definition, and provide a hint about `--all` option for
most cargo commands, which allow the command to work in the way most
probably expected.
Fixes <https://github.com/rust-lang/cargo/issues/3526>
bors [Tue, 8 Aug 2017 00:05:36 +0000 (00:05 +0000)]
Auto merge of #4374 - behnam:new-init, r=alexcrichton
[cargo_new] Hint to use `cargo init` on existing dir
The `new` command always expects a non-existing path. The `init` command
always expects an existing path. Therefore, it makes sense to hint to
use `init` if the pre-condition to `new` is not satisfied.
Fixes <#4366>
bors [Mon, 7 Aug 2017 23:40:25 +0000 (23:40 +0000)]
Auto merge of #4375 - behnam:root-vs-repo, r=alexcrichton
[docs] Update language regarding repository vs package root
In the current documentation, there are many places with language that
assumes a *repository* (as in VCS) is the same as *package root* (the
directory where `Cargo.toml` sits).
With the new workspace features, this is far from true now, and the
inaccurate language makes it difficault for newbies or developers
without much familiarity with the cargo internals with authoring their
manifest files.
This diff tries to use the right terms for places any of these concepts
is referred to:
* Package root,
* Workspace root,
* VCS repository, and
* Package repository/index, like crates.io.
Fixes <https://github.com/rust-lang/cargo/issues/4367>
Behnam Esfahbod [Mon, 7 Aug 2017 19:48:12 +0000 (12:48 -0700)]
[sources/path] Support leading slash in glob patterns
Background: https://github.com/rust-lang/cargo/issues/4268
This diff takes us to **Stage 1.1** of the migration plan by allowing
glob patterns to include a leading slash, so that glob patterns can be
updated, if needed, to start with a slash, closer to the future behavior
with gitignore-like matching.
Why is this stage needed?
It's common to have `package.include` set like this:
```
include = ["src/**"]
```
In old interpretation, this would only include all files under the `src`
directory under the package root. With the new interpretation, this
would match any path with some directory called `src`, even if it's not
directly under the package root.
After this patch, package owners can start marking glob patters with a
leading slash to fix the warning thrown, if any.
One thing to notice here is that there are no extra matchings, but, if
a manifest has already a pattern with a leading slash, this would
silently start matching it with the paths. I believe this is fine, since
the old behavior would have been for the pattern to not match anything,
therefore the item was useless.
See also <https://github.com/rust-lang/cargo/issues/4377> for suggestion
to throw warning on useless/invalid patterns in these fields.
Behnam Esfahbod [Mon, 7 Aug 2017 18:44:34 +0000 (11:44 -0700)]
[docs/manifest] Add Virtual Manifest section
Current documentation does not mention Virtual Manifests at all, which
can be confusing because they appear in error messages.
Here we add the definition, and provide a hint about `--all` option for
most cargo commands, which allow the command to work in the way most
probably expected.
Fixes <https://github.com/rust-lang/cargo/issues/3526>
Behnam Esfahbod [Mon, 7 Aug 2017 18:26:53 +0000 (11:26 -0700)]
[docs] Wrap long lines
Behnam Esfahbod [Mon, 7 Aug 2017 18:11:36 +0000 (11:11 -0700)]
[docs] Update language regarding repository vs package root
In the current documentation, there are many places with language that
assumes a *repository* (as in VCS) is the same as *package root* (the
directory where `Cargo.toml` sits).
With the new workspace features, this is far from true now, and the
inaccurate language makes it difficault for newbies or developers
without much familiarity with the cargo internals with authoring their
manifest files.
This diff tries to use the right terms for places any of these concepts
is referred to:
* Package root,
* Workspace root,
* VCS repository, and
* Package repository/index, like crates.io.
Behnam Esfahbod [Mon, 7 Aug 2017 16:31:32 +0000 (09:31 -0700)]
[cargo_new] Hint to use `cargo init` on existing dir
The `new` command always expects a non-existing path. The `init` command
always expects an existing path. Therefore, it makes sense to hint to
use `init` if the pre-condition to `new` is not satisfied.
Fixes <https://github.com/rust-lang/cargo/issues/4366>
Behnam Esfahbod [Mon, 7 Aug 2017 16:05:02 +0000 (09:05 -0700)]
[bin/init] Update USAGE
bors [Mon, 7 Aug 2017 04:12:18 +0000 (04:12 +0000)]
Auto merge of #4372 - frankmcsherry:patch-1, r=alexcrichton
Modernize explanation of `build.rs`
After some recent head-banging, it was explained to me that `"build.rs"` is a special file name, and that Cargo will build such a file even if you do not expect it to, for example if `Cargo.toml` contains the commented out line
```
#build = "build.rs"
```
Some experimentation lead me to the described behavior, but if it misses any subtle details please feel free to correct. The old text is incorrect, though.
bors [Mon, 7 Aug 2017 03:49:33 +0000 (03:49 +0000)]
Auto merge of #4369 - Wallacoloo:specifying-dependencies-typo, r=alexcrichton
Fix repeated "to to" in Specifying Dependencies
Fixes the typo:
> [...] boil down to the ability to **to** work with a crate [...]
Frank McSherry [Sun, 6 Aug 2017 20:57:13 +0000 (16:57 -0400)]
Modernize explanation of `build.rs`
After some recent head-banging, it was explained to me that `"build.rs"` is a special file name, and that Cargo will build such a file even if you do not expect it to, for example if `Cargo.toml` contains the commented out line
```
#build = "build.rs"
```
Some experimentation lead me to the described behavior, but if it misses any subtle details please feel free to correct. The old text is incorrect, though.
Colin Wallace [Sun, 6 Aug 2017 02:01:24 +0000 (19:01 -0700)]
Fix repeated "to to" in Specifying Dependencies